import javax.swing.*;
import java.awt.*;

public class DemoText extends JPanel
{
  public DemoText()
  {
    // Colocamos el layout BorderLayout
    setLayout(new BorderLayout());

    // Creamos los tres componentes basicos de texto
    JTextField textField = new JTextField();
    JTextArea textArea = new JTextArea();
    JPasswordField textPassword=new JPasswordField();

    add(textField, BorderLayout.NORTH);
    add(new JScrollPane(textArea), BorderLayout.CENTER);
    add(textPassword, BorderLayout.SOUTH);
  }

  public static void main(String args[])
  {
	JFrame ventana=new JFrame("Demo Text");
	ventana.getContentPane().add(new DemoText());
	ventana.setSize(200,150); 
	ventana.setVisible(true);
	ventana.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }
}
